package com.ctlele.team.space.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {

    private static final String DATE_FORMAT_DAY = "yyyy-MM-dd";

    private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

    private static final ThreadLocal<DateFormat> threadLocal = ThreadLocal.withInitial(() -> new SimpleDateFormat(DATE_FORMAT_DAY));

    public static String format(Date date) {
        return threadLocal.get().format(date);
    }
}
